<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- 引入easyui 的主题样式  和  easyui 提供的图标样式 -->
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/themes/bootstrap/easyui.css" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/themes/icon.css" />
<!-- 引入jquery 和  easyui.js   中文设置js-->
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-1.9.1.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js"></script>
</head>
<script type="text/javascript">
$(function(){
	$('#dg').datagrid({    
		url:'Addorder',
		fitColumns:true,
	    columns:[[  
	      
	        {field:'orId',title:'订单id',width:100,hidden:true},    
	        {field:'orDeliveryDate',title:'收货日期 ',width:100,hidden:true}, 
	        {field:'otId',title:'订单类别',width:100,hidden:true},
	        {field:'orState',title:'订单状态',width:100,hidden:true},
	        {field:'orRemarks',title:'备注',width:100,hidden:true},
	        {field:'orSenderName',title:'寄件人姓名',width:100,hidden:true},
	        {field:'orSenderPhone',title:'寄件人电话',width:100,hidden:true}, 
	        {field:'orSenderCompanyPhone',title:'寄件人单位电话',width:100,hidden:true},
	        {field:'orSenderAddr',title:'寄件人地址',width:100,hidden:true},
	        {field:'orRecipientName',title:'收件人姓名',width:100,hidden:true},
	        {field:'orRecipientPhone',title:'收件人电话',width:100,hidden:true},
	        {field:'orRecipientCompanyPhone',title:'收件人单位电话',width:100,hidden:true},
	        {field:'orRecipientAddr',title:'收件人地址',width:100,hidden:true},
	        {field:'orCargoWeight',title:'货物重量',width:100,hidden:true},
	        {field:'orCargoVolume',title:'货物体积',width:100,hidden:true},
	        {field:'orItemName',title:'物品名称',width:100,hidden:true},
	        {field:'orItemNumber',title:'物品数量',width:100,hidden:true},
	        {field:'cyId',title:'货物类别id',width:100,hidden:true},
	        {field:'orInsuredValue',title:'保价金额',width:100,hidden:true},
	        {field:'orPostage',title:'资费',width:100,hidden:true},
	        {field:'orTotalCost',title:'总计费用',width:100,hidden:true},
	        {field:'orPaymentMethod',title:'支付方式',width:100,hidden:true},
	        {field:'orIssuanceDate',title:'发货日',width:100,hidden:true},
	        {field:'orstates',title:'订单状态',width:100,hidden:true},
	        {field:'dpIdf',title:'发货地',width:100,hidden:true},
	        {field:'dpIds',title:'收货地',width:100,hidden:true},
	        {field:'csId',title:'订单状态id',width:100,hidden:true},
	        {field:'customerId',title:'客户id',width:100,hidden:true},
	        {field:'eiId',title:'配送点员工id',width:100,hidden:true},
	        {field:'packageId',title:'封装袋id',width:100,hidden:true},	    
	    ]],
	 toolbar: [{
			iconCls: 'icon-edit',
			text:'用户下单',
			handler: function(){
				$("#win2").window('open');			
			}
	 }]
	})
	//下单窗口
	$('#win2').window({
		width : 1000,
		height : 500,
		modal : true,
		title : "用户下单",
		collapsible : false,
		minimizable : false,
		maximizable : false,
		closable : false,
		closed : true
	});
	

	

	//增加确定按钮
	$('#btnyes2').linkbutton({
		onClick : function() {
			$('#win2').window("close"); 
			var orSenderName = $("#orSenderName").val();
			var orSenderPhone = $("#orSenderPhone").val();
			var orSenderCompanyPhone = $("#orSenderCompanyPhone").val();
			var orSenderAddr = $("#orSenderAddr").val();
			var orRecipientName = $("#orRecipientName").val();
			var orRecipientPhone = $("#orRecipientPhone").val();
			var orRecipientCompanyPhone = $("#orRecipientCompanyPhone").val();
			var orRecipientAddr= $("#orRecipientAddr").val();
			var orItemName= $("#orItemName").val();
			var orItemNumber= $("#orItemNumber").val();
			var orPaymentMethod= $("#orPaymentMethod").val();
			$.ajax({
				url : 'Addorder',
				type : 'post',
				data : {
					'orSenderName' : orSenderName,
					'orSenderPhone':orSenderPhone,
					'orSenderCompanyPhone':orSenderCompanyPhone,
					'orSenderAddr':orSenderAddr,
					'orRecipientName':orRecipientName,
					'orRecipientPhone':orRecipientPhone,
					'orRecipientCompanyPhone':orRecipientCompanyPhone,
					'orRecipientAddr':orRecipientAddr,
					'orItemName':orItemName,
					'orItemNumber':orItemNumber,
					'orPaymentMethod':orPaymentMethod,	
				},
				dataType : 'text',
				success : function(data) {
					if (data == 1) {
						$.messager.show({
							title : '信息提示',
							msg : '下单成功',
							timeout : 1000,
							showType : 'slide'
						});
					
					} else {
						$.messager.show({
							title : '信息提示',
							msg : '下单失败',
							timeout : 1000,
							showType : 'slide'
						});
					}

				}
			});
			
			
			
		}	
	});
	//清除按钮
$('#cls').linkbutton({
		onClick : function() {
			document.getElementById('orid').value = '';
			document.getElementById('orDeliveryDate').value = '';
			document.getElementById('otId').value = '';
			document.getElementById('orState').value = '';
			document.getElementById('orRemarks').value = '';
			document.getElementById('orSenderCompanyPhone').value = '';
			document.getElementById('orSenderName').value = '';
			document.getElementById('orSenderPhone').value = '';
			document.getElementById('orSenderAddr').value = '';
			document.getElementById('orRecipientName').value = '';
			document.getElementById('orRecipientPhone').value = '';
			document.getElementById('orRecipientCompanyPhone').value = '';
			document.getElementById('orRecipientAddr').value = '';
			document.getElementById('orCargoWeight').value = '';
			document.getElementById('orCargoVolume').value = '';
			document.getElementById('orItemName').value = '';
			document.getElementById('orItemNumber').value = '';
			document.getElementById('cyId').value = '';
			document.getElementById('orInsuredValue').value = '';
			document.getElementById('orPostage').value = '';
			document.getElementById('orTotalCost').value = '';
			document.getElementById('orPaymentMethod').value = '';
		}
	});
	   
	
	//返回按钮
	$('#btnfan2').linkbutton({
		onClick : function() {
			$('#win2').window("close");
		}
	});

})
</script>
<body>
<table id="dg"></table>
<!-- 新增订单信息 -->
<div id="win2">	

<div style="margin-left: 500px; margin-top: 40px;" >
<a>SZL物流配送订单</a>
</div>
<div style="margin-left: 200px; margin-top: 50px; width: 800px;">
       订单id:<input id="orid" type="text" name="orid" style="width: 10%; height: 28px">
   收货日期:<input id="orDeliveryDate" type="text" name="orDeliveryDate" style="width: 10%; height:28px">
  订单类别:<input id="otId" type="text" name="otId" style="width: 5%; height:28px">
   订单状态:<input id="orState" type="text" name="orState" style="width: 10%; height:28px">
         备注  :<input id="orRemarks" type="text" name="orRemarks" style="width: 20%; height:28px">
  </div>
 <div  style="margin-left: 200px; margin-top: 10px; width: 800px;"> 
    寄件人姓名:<input id="orSenderName" type="text" name="orSenderName" style="width: 10%; height:28px">
      寄件人电话:<input id="orSenderPhone" type="text" name="orSenderPhone" style="width: 10%; height:28px">
    寄件人单位电话:<input id="orSenderCompanyPhone" type="text" name="orSenderCompanyPhone" style="width: 10%; height:28px">
        寄件人地址:<input id="orSenderAddr" type="text" name="orSenderAddr" style="width: 10%; height:28px">
</div>
<div style="margin-left: 200px; margin-top: 10px; width: 800px;"> 
  收件人姓名:<input id="orRecipientName" type="text" name="orRecipientName" style="width: 10%; height:28px">
   收件人电话 :<input id="orRecipientPhone" type="text" name="orRecipientPhone" style="width: 10%; height:28px">
     收件人单位电话: <input id="orRecipientCompanyPhone" type="text" name="orRecipientCompanyPhone" style="width: 10%; height:28px">
      收件人地址:<input id="orRecipientAddr" type="text" name="orRecipientAddr" style="width: 10%; height:28px">
</div>

<div style="margin-left: 200px; margin-top: 10px; width: 360px;background-color: green;}">
             货物资料<br>
      货物重量(kg):<input id="orCargoWeight" type="text" name="orCargoWeight" style="width: 10%; height:28px">
       货物体积(m3):<input id="orCargoVolume" type="text" name="orCargoVolume" style="width: 10%; height:28px">
	物品名称:<input id="orItemName" type="text" name="orItemName" style="width: 10%; height:28px">
	物品数量:<input id="orItemNumber" type="text" name="orItemNumber" style="width: 10%; height:28px">	
          货物类别: <select id="cyId" class="easyui-combobox" name="cyId" style="width: 20%; height:28px">   
                <option value="aa">1</option>   
                <option>2</option>     
           </select>  
           （*1代表普通商品，2代表贵重商品）
</div>
<div style="margin-left:570px; margin-top:-85px; width: 350px;background-color: gray;">
                 资费情况<br>
       保价金额(￥元):<input id="orInsuredValue" type="text" name="orInsuredValue" style="width: 20%; height:28px">
	资费(￥元):<input id="orPostage" type="text" name="orPostage" style="width: 20%; height:28px">
	总计费用(￥元):<input id="orTotalCost" type="text" name="orTotalCost" style="width: 20%; height:28px">
          支付方式：<select id="orPaymentMethod" class="easyui-combobox" name="orPaymentMethod" style="width: 20%; height:28px">   
                <option value="寄件人">寄件人</option>   
                <option value="收件人">收件人</option>   
                <option value="第三方支付">第三方支付</option>    
           </select>  

</div>

<div style="margin-left: 200px; margin-top: 10px; width: 600px;">
 发货日期: <input id="orIssuanceDate" type="text" name="orIssuanceDate" style="width: 30%; height:28px">
</div>

<div style="margin-left: 500px; margin-top: 5px; width: 400px;align:'center'">
	 <a id="btnyes2" href="#" iconCls="icon-ok" style="width: 50px; height: 50px">确定</a> 
	 <a id="btnfan2" href="#" iconCls="icon-redo" style="width: 50px; height: 50px">返回</a>	
     <input type="button" id="cls" value="清空" />
</div>
   
</div>
</body>
</html>